package com.uni.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
public class AliyunConfig {
    private String endpoint = "oss-cn-hangzhou.aliyuncs.com";
    private String accessKeyId = "LTAI5t8sUjGtRRAEzN1pR5JT";
    private String accessKeySecret = "dLg9KQ7VROxIEALNzbHYjgqUspGqGZ";
    private String bucketName = "uni1024";
    private String urlPrefix= "https://uni1024.oss-cn-hangzhou.aliyuncs.com/";

    @Bean
    public OSS OSSClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}
